home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 22 / Amiga Format AFCD22 (Jan 1998, Issue 106).iso / -in_the_mag- / converters / graphics / netpbm / source1 / pbm / makefile.dice < prev    next >
Makefile  |  1997-11-16  |  10KB  |  252 lines

  1. # Makefile for pbm tools, for use with Amiga DICE
  2. #
  3. # Copyright (C) 1989, 1991 by Jef Poskanzer.
  4. # Modified for Amiga DICE by Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
  5. #
  6. # Permission to use, copy, modify, and distribute this software and its
  7. # documentation for any purpose and without fee is hereby granted, provided
  8. # that the above copyright notice appear in all copies and that both that
  9. # copyright notice and this permission notice appear in supporting
  10. # documentation.  This software is provided "as is" without express or
  11. # implied warranty.
  12.  
  13. # CONFIG: generate executable with debugging information
  14. #DEBUG =     -s -d1
  15. # CONFIG: use memory pools
  16. #MPOOL =     -L/amiga -l mpool
  17.  
  18. CC =            dcc
  19. CFLAGS =        -E DCC_ERRORS -ms -mu -gs $(DEBUG)
  20. #RGBDEF =        -DRGB_DB="RGBDEF"  # moved to pbmplus.h
  21. TIFFDEF =       -DLIBTIFF
  22. LDFLAGS =       $(MPOOL) /amiga/dice_stack.o
  23. BINDIR =        bin
  24. MERGE=          pbmmerge
  25.  
  26. # where to install the binaries, libraries and important header files
  27. INSTALLBIN =    bin:pbmplus
  28. INSTALLLIB =    dlib:local
  29. INSTALLINCL=    dinclude:local
  30. # install which headers
  31. HEADERS=        pbm.h pbmfont.h /pbmplus.h
  32.  
  33. INCLUDE =       -I/
  34. RALLCFLAGS =    $(CFLAGS) $(RGBDEF) $(TIFFDEF) $(INCLUDE) -proto -mRR
  35. SALLCFLAGS =    $(CFLAGS) $(RGBDEF) $(TIFFDEF) $(INCLUDE) -proto
  36. MALLCFLAGS =    $(CFLAGS) $(RGBDEF) $(TIFFDEF) $(INCLUDE) -mD -mC
  37. DEFPBM =        pbm.h /pbmplus.h
  38. DEFLIBPBM =     libpbm.h
  39. RLIBPBM =       pbmsr.lib
  40. RLLIBPBM =      pbmrl.lib
  41. SLIBPBM =       pbms.lib
  42. SLLIBPBM =      pbml.lib
  43. DEFPBM2 =       /version.h /compile.h   # special dep for libpbm1.c
  44.  
  45. LIBRARIES =     $(RLIBPBM) $(RLLIBPBM) $(SLIBPBM) $(SLLIBPBM)
  46.  
  47. BINS =          atktopbm brushtopbm cmuwmtopbm \
  48.                 icontopbm gemtopbm macptopbm mgrtopbm \
  49.                 pbmlife pbmmake pbmmask \
  50.                 pbmtext pbmto10x pbmto4425 pbmtoascii pbmtoatk \
  51.                 pbmtobbnbg pbmtocmuwm pbmtoepson pbmtog3 \
  52.                 pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \
  53.                 pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \
  54.                 pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \
  55.                 pbmupc pi3topbm xbmtopbm ybmtopbm \
  56.                 pbmtoepsi pbmclean pbmpscale pbmtoln03
  57.  
  58. LBINS   =       g3topbm
  59.  
  60. MATHBINS =      pbmreduce pbmtolps
  61.  
  62. # Compile these programs without proto checking, with stackargs & large data.
  63. # The source is quite messy and would require too much work to clean up.
  64. UGLYFLAGS =     -E DCC_ERRORS -ms -mu -gs -mD -mC $(RGBDEF) $(TIFFDEF) $(INCLUDE)
  65. UGLYBINS =      pktopbm
  66. MUGLYBINS =     pbmtopk
  67.  
  68. BINARIES =      $(BINS) $(LBINS) $(MATHBINS) $(UGLYBINS) $(MUGLYBINS)
  69.  
  70. OBJECTS =       atktopbm.om brushtopbm.om cmuwmtopbm.om g3topbm.om \
  71.                 icontopbm.om gemtopbm.om macptopbm.om mgrtopbm.om \
  72.                 pbmlife.om pbmmake.om pbmmask.om pbmreduce.om \
  73.                 pbmtext.om pbmto10x.om pbmto4425.om pbmtoascii.om pbmtoatk.om \
  74.                 pbmtobbnbg.om pbmtocmuwm.om pbmtoepson.om pbmtog3.om \
  75.                 pbmtogem.om pbmtogo.om pbmtoicon.om pbmtolj.om pbmtomacp.om \
  76.                 pbmtomgr.om pbmtopi3.om pbmtoplot.om pbmtoptx.om \
  77.                 pbmtox10bm.om pbmtoxbm.om pbmtoybm.om pbmtozinc.om \
  78.                 pbmupc.om pi3topbm.om xbmtopbm.om ybmtopbm.om \
  79.                 pbmtoepsi.om pbmclean.om pbmpscale.om \
  80.                 pbmtolps.om pbmtoln03.om
  81.  
  82. UGLYOBJS =      pktopbm.ou pbmtopk.ou
  83.  
  84. all:            lib binaries
  85.  
  86. bindir:
  87.                 -makedir $(BINDIR)
  88.  
  89. binaries:       lib bindir $(BINARIES)
  90.  
  91. lib:            $(LIBRARIES)
  92.  
  93. merge:          lib bindir $(MERGE)
  94.  
  95.  
  96. # Rules for merged binary
  97. .c.ou:    $(DEFPBM) $<
  98.         $(CC) $(MALLCFLAGS) "-Dmain=$*_main" -c $*.c -o $*.ou
  99. .c.om:       $(DEFPBM) $<
  100.         $(CC) -proto $(MALLCFLAGS) "-Dmain=$*_main" -c $*.c -o $*.om
  101. $(MERGE):       pbmmerge.c $(OBJECTS) $(UGLYOBJS) $(SLLIBPBM)
  102.         $(CC) $(MALLCFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c $(OBJECTS) $(UGLYOBJS) -l $(SLLIBPBM) -lm
  103. #$(OBJECTS):     $(DEFPBM)
  104. #        $(CC) -mD -mC $(SALLCFLAGS) "-Dmain=$*_main" -c $*.c
  105.  
  106.  
  107. # Rules for plain programs.
  108. $(BINS):        $(DEFPBM) $(RLIBPBM)
  109.         $(CC) -r $(RALLCFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c -l $(RLIBPBM)
  110.  
  111. $(LBINS):       $(DEFPBM) $(RLLIBPBM)
  112.         $(CC) -mD -mC $(RALLCFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c -l $(RLLIBPBM)
  113.  
  114. $(MATHBINS):    $(DEFPBM) $(RLIBPBM)
  115.         $(CC) -r $(RALLCFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c -l $(RLIBPBM) -lm
  116.  
  117. $(UGLYBINS):    $(DEFPBM) $(SLLIBPBM)
  118.         $(CC) $(UGLYFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c -l $(SLLIBPBM)
  119.  
  120. $(MUGLYBINS):   $(DEFPBM) $(SLLIBPBM)
  121.         $(CC) $(UGLYFLAGS) $(LDFLAGS) -o $(BINDIR)/$@ $@.c -l $(SLLIBPBM) -lm
  122.  
  123.  
  124. # And libraries.
  125. # small data version of libpbm, registerized (arguments in registers)
  126. $(RLIBPBM):     libpbm1.or libpbm2.or libpbm3.or libpbm4.or libpbm5.or
  127.         -delete $(RLIBPBM)
  128.         join libpbm1.or libpbm2.or libpbm3.or libpbm4.or libpbm5.or to $(RLIBPBM)
  129. libpbm1.or:      $(DEFPBM) $(DEFPBM2) $(DEFLIBPBM) libpbm1.c
  130.         $(CC) -r $(RALLCFLAGS) -S -o $@ -c libpbm1.c
  131. libpbm2.or:      $(DEFPBM) $(DEFLIBPBM) libpbm2.c
  132.         $(CC) -r $(RALLCFLAGS) -S -o $@ -c libpbm2.c
  133. libpbm3.or:      $(DEFPBM) $(DEFLIBPBM) libpbm3.c
  134.         $(CC) -r $(RALLCFLAGS) -S -o $@ -c libpbm3.c
  135. libpbm4.or:      $(DEFPBM) $(DEFLIBPBM) libpbm4.c
  136.         $(CC) -r $(RALLCFLAGS) -S -o $@ -c libpbm4.c
  137. libpbm5.or:      $(DEFPBM) pbmfont.h libpbm5.c
  138.         $(CC) -r $(RALLCFLAGS) -S -o $@ -c libpbm5.c
  139.  
  140. # small data version, not registerized (arguments on stack)
  141. $(SLIBPBM):      libpbm1.os libpbm2.os libpbm3.os libpbm4.os libpbm5.os
  142.         -delete $(SLIBPBM)
  143.         join libpbm1.os libpbm2.os libpbm3.os libpbm4.os libpbm5.os to $(SLIBPBM)
  144. libpbm1.os:     $(DEFPBM) $(DEFPBM2) $(DEFLIBPBM) libpbm1.c
  145.         $(CC) -r $(SALLCFLAGS) -S -o $@ -c libpbm1.c
  146. libpbm2.os:     $(DEFPBM) $(DEFLIBPBM) libpbm2.c
  147.         $(CC) -r $(SALLCFLAGS) -S -o $@ -c libpbm2.c
  148. libpbm3.os:     $(DEFPBM) $(DEFLIBPBM) libpbm3.c
  149.         $(CC) -r $(SALLCFLAGS) -S -o $@ -c libpbm3.c
  150. libpbm4.os:     $(DEFPBM) $(DEFLIBPBM) libpbm4.c
  151.         $(CC) -r $(SALLCFLAGS) -S -o $@ -c libpbm4.c
  152. libpbm5.os:     $(DEFPBM) pbmfont.h libpbm5.c
  153.         $(CC) -r $(SALLCFLAGS) -S -o $@ -c libpbm5.c
  154.  
  155. # large data version of libpbm, registerized (arguments in registers)
  156. $(RLLIBPBM):    libpbm1.olr libpbm2.olr libpbm3.olr libpbm4.olr libpbm5.olr
  157.         -delete $(RLLIBPBM)
  158.         join libpbm1.olr libpbm2.olr libpbm3.olr libpbm4.olr libpbm5.olr to $(RLLIBPBM)
  159. libpbm1.olr:      $(DEFPBM) $(DEFPBM2) $(DEFLIBPBM) libpbm1.c
  160.         $(CC) -mD $(RALLCFLAGS) -S -o $@ -c libpbm1.c
  161. libpbm2.olr:      $(DEFPBM) $(DEFLIBPBM) libpbm2.c
  162.         $(CC) -mD $(RALLCFLAGS) -S -o $@ -c libpbm2.c
  163. libpbm3.olr:      $(DEFPBM) $(DEFLIBPBM) libpbm3.c
  164.         $(CC) -mD $(RALLCFLAGS) -S -o $@ -c libpbm3.c
  165. libpbm4.olr:      $(DEFPBM) $(DEFLIBPBM) libpbm4.c
  166.         $(CC) -mD $(RALLCFLAGS) -S -o $@ -c libpbm4.c
  167. libpbm5.olr:      $(DEFPBM) pbmfont.h libpbm5.c
  168.         $(CC) -mD $(RALLCFLAGS) -S -o $@ -c libpbm5.c
  169.  
  170. # large data version of libpbm, not registerized (arguments on stack)
  171. $(SLLIBPBM):      libpbm1.ols libpbm2.ols libpbm3.ols libpbm4.ols libpbm5.ols
  172.         -delete $(SLLIBPBM)
  173.         join libpbm1.ols libpbm2.ols libpbm3.ols libpbm4.ols libpbm5.ols to $(SLLIBPBM)
  174. libpbm1.ols:    $(DEFPBM) $(DEFPBM2) $(DEFLIBPBM) libpbm1.c
  175.         $(CC) -mD $(SALLCFLAGS) -S -o $@ -c libpbm1.c
  176. libpbm2.ols:    $(DEFPBM) $(DEFLIBPBM) libpbm2.c
  177.         $(CC) -mD $(SALLCFLAGS) -S -o $@ -c libpbm2.c
  178. libpbm3.ols:    $(DEFPBM) $(DEFLIBPBM) libpbm3.c
  179.         $(CC) -mD $(SALLCFLAGS) -S -o $@ -c libpbm3.c
  180. libpbm4.ols:    $(DEFPBM) $(DEFLIBPBM) libpbm4.c
  181.         $(CC) -mD $(SALLCFLAGS) -S -o $@ -c libpbm4.c
  182. libpbm5.ols:    $(DEFPBM) pbmfont.h libpbm5.c
  183.         $(CC) -mD $(SALLCFLAGS) -S -o $@ -c libpbm5.c
  184.  
  185.  
  186. # Other dependencies.
  187. atktopbm atktopbm.om:            atktopbm.c
  188. brushtopbm brushtopbm.om:        brushtopbm.c
  189. cmuwmtopbm cmuwmtopbm.om:        cmuwmtopbm.c cmuwm.h
  190. g3topbm g3topbm.om:              g3topbm.c g3.h
  191. icontopbm icontopbm.om:          icontopbm.c
  192. gemtopbm gemtopbm.om:            gemtopbm.c
  193. macptopbm macptopbm.om:          macptopbm.c macp.h
  194. mgrtopbm mgrtopbm.om:            mgrtopbm.c mgr.h
  195. pbmlife pbmlife.om:              pbmlife.c
  196. pbmmake pbmmake.om:              pbmmake.c
  197. pbmmask pbmmask.om:              pbmmask.c
  198. pbmreduce pbmreduce.om:          pbmreduce.c
  199. pbmtext pbmtext.om:              pbmtext.c pbmfont.h
  200. pbmto10x pbmto10x.om:            pbmto10x.c
  201. pbmto4425 pbmto4425.om:          pbmto4425.c
  202. pbmtoascii pbmtoascii.om:        pbmtoascii.c
  203. pbmtoatk pbmtoatk.om:            pbmtoatk.c
  204. pbmtobbnbg pbmtobbnbg.om:        pbmtobbnbg.c
  205. pbmtocmuwm pbmtocmuwm.om:        pbmtocmuwm.c cmuwm.h
  206. pbmtoepson pbmtoepson.om:        pbmtoepson.c
  207. pbmtog3 pbmtog3.om:              pbmtog3.c g3.h
  208. pbmtogem pbmtogem.om:            pbmtogem.c
  209. pbmtogo pbmtogo.om:              pbmtogo.c
  210. pbmtoicon pbmtoicon.om:          pbmtoicon.c
  211. pbmtolj pbmtolj.om:              pbmtolj.c
  212. pbmtomacp pbmtomacp.om:          pbmtomacp.c macp.h
  213. pbmtomgr pbmtomgr.om:            pbmtomgr.c mgr.h
  214. pbmtopi3 pbmtopi3.om:            pbmtopi3.c
  215. pbmtoplot pbmtoplot.om:          pbmtoplot.c
  216. pbmtoptx pbmtoptx.om:            pbmtoptx.c
  217. pbmtox10bm pbmtox10bm.om:        pbmtox10bm.c
  218. pbmtoxbm pbmtoxbm.om:            pbmtoxbm.c
  219. pbmtoybm pbmtoybm.om:            pbmtoybm.c
  220. pbmtozinc pbmtozinc.om:          pbmtozinc.c
  221. pbmupc pbmupc.om:                pbmupc.c
  222. pi3topbm pi3topbm.om:            pi3topbm.c
  223. xbmtopbm xbmtopbm.om:            xbmtopbm.c
  224. ybmtopbm ybmtopbm.om:            ybmtopbm.c
  225. pbmtoepsi pbmtoepsi.om:          pbmtoepsi.c
  226. pbmtopk pbmtopk.om:              pbmtopk.c
  227. pktopbm pktopbm.om:              pktopbm.c
  228. pbmclean pbmclean.om:            pbmclean.c
  229. pbmpscale pbmpscale.om:          pbmpscale.c
  230. pbmtolps pbmtolps.om:            pbmtolps.c
  231. pbmtoln03 pbmtoln03.om:          pbmtoln03.c
  232.  
  233. clean:
  234.         -delete \#.om \#?.ou \#?.os \#?.or \#?.ols \#?.olr DCC_ERRORS
  235.  
  236. cleanall:   clean
  237.         -delete \#?.lib
  238.         -delete $(BINDIR) all
  239.  
  240. installlib:     lib
  241.         copy $(LIBRARIES) to $(INSTALLLIB)
  242.         copy $(HEADERS) to $(INSTALLINCL)
  243.  
  244. installbin:     binaries
  245.         copy $(BINDIR) all to $(INSTALLBIN)
  246.  
  247. installall:     installlib installbin
  248.  
  249. install:
  250.         @echo "Please select: installlib, installbin, installall"
  251.  
  252.